<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>活动管理</title>
<%@ include file="/module/js.jsp"%>
<script type="text/javascript">
	$(document).ready(function(){

	    //加载表格分页数据
        $('#dg').datagrid({
            url:'${basePath}/partyActivity/grpj/listData?hdType=${hdType}',
            pagination:true,
            collapsible:true,
			method:'post',
            remoteSort:true,
            columns:[[
                {field:'hDID',checkbox:true,width:120,align:'center'},
                {field:'hDMC',title:'活动名称',width:150,align:'center',formatter:modify_formater},
                {field:'hDRQ',title:'活动日期',width:200,align:'center',formatter:formatDate},
                {field:'hDSJ',title:'活动时间',width:200,align:'center'},
                {field:'hDDD',title:'活动地点',width:300,align:'center'},
                {field:'hDZT',title:'活动主题',width:300,align:'center'}
            ]]
        });

     
        //查询
        $("#btnQuery").click(function(){
            $('#dg').datagrid('load',{
                hDMC: $('#hDMC').val(),
                hDZT: $('#hDZT').val(),
                bdate: $('#bdate').val(),
                edate: $('#edate').val()
            });
        });
        
        
	});

	//修改
    function modify_formater(value, row, index) {
        return "<a href='${basePath}/partyActivity/grpj/premodify?hdType=${hdType}&id=" + row.hDID + "'>" + value + "</a>";
    }

    function formatDate(value){
        var date=new Date(value);
        return date.Format("yyyy-MM-dd");
    }


    Date.prototype.Format = function (fmt) {
        var o = {
            "M+": this.getMonth() + 1, //月份
            "d+": this.getDate(), //日
            "H+": this.getHours(), //小时
            "m+": this.getMinutes(), //分
            "s+": this.getSeconds(), //秒
            "q+": Math.floor((this.getMonth() + 3) / 3), //季度
            "S": this.getMilliseconds() //毫秒
        };
        if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o)
            if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
        return fmt;
    }


    if ("${msg}" != "") {
        layer.alert("${msg}", {
            icon : 6
        });
    }

</script>
</head>
<body >
	<form action="#" name="partyActivityForm" id="partyActivityForm" method="post">
        <input type="hidden" name="hdType" id="hdType" value="${hdType}"/>
		<table cellpadding="1" cellspacing="1" border="0">
			<tr>
				<td>
                    <input type="button" id="btnQuery" autocomplete="off"  value="查询"
                           class="inputButton" />
                </td>
			</tr>
		</table>
		<table cellpadding="1" cellspacing="1">
			<tr>
				<td>活动名称：</td>
				<td>
                    <input type="text" id="hDMC" name="hDMC" value="" class="inputText2"/>
                </td>
				<td>活动主题：</td>
                <td>
                    <input type="text" id="hDZT" name="hDZT" value="" class="inputText2" />
                </td>
				<td>活动日期：</td>
				<td>
                    从
                    <input name="bdate" id="bdate"  autocomplete="off"
                           class="Wdate required inputText2" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                    到
                    <input name="edate" id="edate" autocomplete="off"
                           class="Wdate required inputText2" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                </td>
			</tr>
		</table>
		<br/>
		<table id="dg"></table>

        <div id="div1" style="display: none;">
            <table cellpadding="0" style="padding-top: 20px;" cellspacing="0" border="0" class="table-border" width="100%">
                <tr>
                    <td class="table-titleTD" style="width: 30%"><font
                            style="color: red;">*</font>日期：</td>
                    <td class="table-contentTD" style="width: 70%">
                        每月的<select name="partyFixedDateActivityDay" id="partyFixedDateActivityDay" class="selectList">
                        <c:forEach var="i" begin="1" end="28">
                            <option value="${i}">${i}</option>
                        </c:forEach>
                    </select>号</td>
                </tr>
            </table>
        </div>

	</form>
</body>
</html>
